<!DOCTYPE html>
<html class="x-admin-sm">

<head>
    <meta charset="UTF-8">
    <title>查看单位维护人员页面</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi"/>
    <link rel="stylesheet" href="./css/font.css">
    <link rel="stylesheet" href="./css/xadmin.css">
    <script src="./lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="./js/xadmin.js"></script>
    <!--[if lt IE 9]>
    <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
    <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>

<body>
<div class="x-nav">
            <span class="layui-breadcrumb">
                <a>
                    <cite>单位维护人员</cite></a>
            </span>
    <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right"
       onclick="location.reload()" title="刷新">
        <i class="layui-icon layui-icon-refresh" style="line-height:30px"></i>
    </a>
</div>
<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-body ">
                    <form class="layui-form layui-col-space5">
                        <div class="layui-inline layui-show-xs-block">
                            <input type="hidden" class="layui-input" autocomplete="off" placeholder="ID " name="unitid" id="unitid">
                        </div>
                        <div class="layui-inline layui-show-xs-block">
                            <input class="layui-input" autocomplete="off" placeholder="用户名 " name="cname" id="cname">
                        </div>
                        <div class="layui-inline layui-show-xs-block">
                            <input class="layui-input" autocomplete="off" placeholder="姓名 " name="name" id="name">
                        </div>
                        <div class="layui-inline layui-show-xs-block">
                            <input class="layui-input" autocomplete="off" placeholder="微信号" name="openid"
                                   id="openid"></div>
                        <div class="layui-inline layui-show-xs-block">
                            <input class="layui-input" autocomplete="off" placeholder="手机号" name="tel" id="tel">
                        </div>
                        <div class="layui-inline layui-show-xs-block">
                            <button class="layui-btn" lay-submit="" lay-filter="search">
                                <i class="layui-icon">&#xe615;</i></button>
                        </div>
                    </form>
                </div>

                <div class="layui-card-body">
                    <table id="baoxiumanList" lay-filter="baoxiumanList"></table>
                </div>
            </div>
        </div>
    </div>
</div>
</body>
<script type="text/html" id="toolbarDemo">

</script>
<script type="text/html" id="rowBtn">

</script>
<script>
    var gobj = null;
    layui.use(['table', 'form', 'layer','jquery'],
    function () {
        var table = layui.table;
        var $ = layui.jquery;
        var form = layui.form;
        var layer = layui.layer;
        var id = window.location.search.substring(1);
        $("#unitid").prop("value",id);
        var tableIns = table.render({
            elem: '#baoxiumanList',
            url: 'baoxiumanList',
            cellMinWidth: 95,
            page: true,
            where: {"unitid": id},
            height: "full-125",
            limit: 10,
            limits: [10, 15, 20, 25],
            id: "baoxiumanList",
            toolbar: "#toolbarDemo",
            cols: [[
                {type: "checkbox", fixed: "left", width: 50},
                {field: 'id', title: '编号', align: 'center'},
                {field: 'cname', title: '登录名', align: 'center'},
                {field: 'name', title: '姓名', align: 'center'},
                {field: 'openid', title: '微信公众号', align: 'center'},
                {field: 'tel', title: '手机号', align: 'center'},
                {field: 'yzm', title: '验证码', align: 'center'},
                {
                    field: 'status', title: '状态', align: 'center', templet: function (data) {
                        if (data.status == "1")
                            return "正常使用";
                        else if (data.status == "0")
                            return "已停用";
                    }
                }

            ]]
        });

        table.on('row(baoxiumanList)', function (obj) {
            gobj = obj.data;
            console.log(JSON.stringify(gobj));
        });



        //监听搜索事件
        form.on('submit(search)', function (data) {
            table.reload("baoxiumanList", {
                page: {
                    curr: 1
                    //重新从第 1 页开始
                },
                where: data.field
            });
            return false;
        });



    });
</script>
<script>
    function callbackdata() {
        if (gobj == null)
            return false;
        return gobj;
    }
</script>
</html>